package cn.tpshion.shop.config;

import cn.tpshion.shop.config.support.OneKeyProperties;
import com.aliyun.dypnsapi20170525.Client;
import com.aliyun.teaopenapi.models.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class OneKeyConfig {

    @Bean
    public Client config(OneKeyProperties oneKeyProperties) throws Exception {
        Config config = new Config();
        config.setAccessKeyId(oneKeyProperties.getAccessKeyId());
        config.setAccessKeySecret(oneKeyProperties.getAccessKeySecret());
        return new Client(config);
    }

}
